#!/bin/bash
Q_NAME=${1:-XXX}
PORT=${2:-8080}
FETCH_CNT=${3:-100}
DI_FLG=${4:-false}
FIXED_DELAY=${5:-5000}
LOG_HOME=${6:-${Q_NAME}}
WAR_NAME=hms.war

setsid java -jar -Dspring.profiles.active=chot -Dlog.home=${LOG_HOME} ${WAR_NAME} --server.port=${PORT} --fetch_cnt=${FETCH_CNT} --queueName=${Q_NAME} --deleteInsert=${DI_FLG} --fixed_delay_ms=${FIXED_DELAY} > /dev/null &
PID=$(ps -ef|grep ${WAR_NAME}|grep ${Q_NAME}|grep java |grep -v grep | awk '{print $2}')
echo "Run hms ${Q_NAME}:${PORT}, PID: $PID"
